package com.nstar.uecenter.view.main.impl
{
	import com.nstar.base.event.AdvanceEvent;
	import com.nstar.base.util.LoadXMLDelegate;
	import com.nstar.base.util.Logger;
	import com.nstar.uecenter.view.components.PopUpTips;
	
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.geom.Point;
	
	import mx.containers.HBox;
	import mx.controls.Text;
	import mx.core.Application;
	import mx.events.FlexEvent;
	import mx.rpc.IResponder;

	public class AboutUsClass extends HBox  implements IResponder
	{
		
		public static const USER_INTERFACE:String = "userInterface";
		public static const INTERACTION_DESIGN:String = "interactionDesign";
		public static const USER_EXPERIENCE_CENTER:String = "userExperienceCenter";
		public static const CONTACT_US:String = "contactUs";
		public static const LABS:String = "labs";
				
		public var txtAboutUs:Text;
		
		private var loader:LoadXMLDelegate ;
		private var logger:Logger = Logger.getInstance();		
		public function AboutUsClass()
		{
			super();
			this.addEventListener(FlexEvent.CREATION_COMPLETE,init);
		}
		
		private function init(event:FlexEvent):void{
			//loadAboutUs();
		}		
		
		//加载实验产品数据
		private function loadAboutUs():void{
			loader = new LoadXMLDelegate(this,"demo/data/AboutUs.xml","object");
			loader.load();
		}
		
		public function result( rpcEvent : Object ) : void
		{
			// call the helper class for parse the XML data
			var desc:Object = rpcEvent.result.about.desc;
			txtAboutUs.text = desc.toString();
			trace("load AboutUs ok!");
		}
		
		// this is called when the delegate receives a fault from the service
		public function fault( rpcEvent : Object ) : void 
		{
			trace("load AboutUs error!!!");
		}	
		
		public function uiHandler(event:MouseEvent):void{
			PopUpTips.show("用户界面","这里是用户界面的定义...",
				150,100);
		}
		
		public function idHandler(event:MouseEvent):void{
			PopUpTips.show("交互设计","这里是交互设计的定义...",
				150,100);
		}
		
		public function uecHandler(event:MouseEvent):void{
			this.dispatchEvent(new AdvanceEvent(USER_EXPERIENCE_CENTER,1,true));
		}
		
		public function contactUsHandler(event:MouseEvent):void{
			this.dispatchEvent(new AdvanceEvent(CONTACT_US,3,true));
		}

		public function labsHandler(event:MouseEvent):void{
			this.dispatchEvent(new AdvanceEvent(LABS,2,true));
		}
		
		public function hide():void{
			PopUpTips.hide();
		}
	}
}